package nl.sanity.events
{
	import flash.net.URLLoader;
	import flash.events.Event;
	
	/**
	 * ServerInterfaceEvent
	 * For usage in combination with the ServerInterface class
	 * 
	 * @langversion ActionScript 3
	 *
	 * @author A. Gosman
	 * @since  28/03/2009
	 */
	public class  ServerInterfaceEvent extends Event
	{
		public static const ON_COMPLETE	: String = "onComplete";
		public static const ON_ERROR	: String = "onError";
		
		private var _data				: Object;
		
		// --- CONSTRUCTOR ----------------------------------------
		
		public function ServerInterfaceEvent ( type:String, data:Object = null, bubbles:Boolean = false, cancelable:Boolean = false )
		{
			_data = data;
			
			super ( type, bubbles, cancelable );
		}
		
		// --- PUBLIC FUNCTIONS ----------------------------------------

		/**
		 * Creates and returns a copy of the current instance.
		 * @return a copy of the current instance.
		 */
		public override function clone():Event
		{
			return new ServerInterfaceEvent( type, _data, bubbles, cancelable );
		}
		
		// --- GETTERS/SETTERS ----------------------------------------

		public function get data():Object
		{
			return _data;
		}
	}
}